home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / ircii2-6.zip / SCRIPTS\NEWFORMA < prev    next >
Text File  |  1994-12-28  |  6KB  |  188 lines

  1. # This script is intended for use with 2.8 servers on all sites.
  2. # It's an extension of the 2.8script but with much much nicer 
  3. # formatting.
  4.  
  5.  
  6. @ RCS.newformat = [$$Header: /splode/u/mrg/src/ircii-2.6/script/RCS/newformat,v 1.2 1994/10/18 09:16:12 mrg Exp $$]
  7. # An operator command. ESC-t turns this option on and off.
  8. # It allows one to see users or not see them in a TRACE.
  9. # It also effects the output of STAT l
  10.  
  11. ^bind meta1-t parse_command tt
  12. ^alias tt if (trace) { assign -trace } { assign trace x }
  13.  
  14. # Stores the output of a trace for use with conall
  15. ^alias trace ^cleantr;//trace $0-
  16.  
  17. ^alias storetrace {
  18.     if (index([ $0)>-1) 
  19.       { assign trace.$strip([].-0123456789/* $0) $left($index([ $0) $0) }
  20.       { assign trace.$strip([].-0123456789/* $0) $0 }
  21. }
  22.  
  23. ^alias cleantr foreach trace ii { assign -trace[$ii] }
  24. # connect to all the servers listed in the last trace
  25. # food for when you restart the server.
  26. ^alias conall foreach trace ii { connect $trace[$ii] }
  27.  
  28. ^alias topic if ([#]==[$[1]0]) { //topic $* } { //topic $C $* }
  29. ^alias invite if ([$1]) { //invite $0 $1 } { //invite $0 $C }
  30.  
  31. # Don't EVER screw with the format() or lformat() commands
  32. # as many other things may use them.
  33. ^alias format {
  34.     @ IRCII.word = [$1-]
  35.     if (@IRCII.word < [$0]) 
  36.         { @ function_return = [$([-$0]IRCII.word)] } 
  37.         { @ function_return = [$IRCII.word] } 
  38. }
  39. ^alias lformat {
  40.     @ IRCII.word = [$1-]
  41.     if (@IRCII.word < [$0]) 
  42.         { @ function_return = [$([$0]IRCII.word)] } 
  43.         { @ function_return = [$IRCII.word] } 
  44. }
  45.  
  46.  
  47. # Trace information
  48. # -----------------
  49.  
  50. # define RPL_TRACELINK        200
  51. ^on ^200 * echo $[7]0 $1 $lformat(23 [$2]) ==> $3-
  52.  
  53. # define RPL_TRACECONNECTING  201
  54. ^on ^201 * echo $[7]0 $1 Class$format(7 [$2]) trying...  ==> $3-
  55.  
  56. # define RPL_TRACEHANDSHAKE   202
  57. ^on ^202 * echo $[7]0 $1 Class$format(7 [$2]) handshake  ==> $3-
  58.  
  59. # define RPL_TRACEUNKNOWN     203
  60. ^on ^203 * echo $[7]0 $1 Class$format(7 [$2]) *unknown*  ==> $3-
  61.  
  62. # define RPL_TRACEOPERATOR    204
  63. ^on ^204 * echo $[7]0 $1 Class$format(7 [$2])  $format(9 1C) ==> $left(35 $3)
  64.  
  65. # define RPL_TRACEUSER        205
  66. ^on ^205 * if (trace) { echo $[7]0 $1 Class$format(7 [$2])  $format(9 1C) ==> $left(35 $3) }
  67.  
  68. # define RPL_TRACESERVER      206
  69. ^on ^206 * storetrace $5;echo $[7]0 $1 Class$format(7 [$2]) $format(4 $3) $format(5 $4) ==> $left(35 $5)
  70.  
  71.  
  72. # define RPL_TRACESERVICE     207
  73. ^on ^207 * echo $[7]0 $1 Class[$format(7 $2)] service    ==> $3-
  74.  
  75. # define RPL_TRACENEWTYPE     208
  76. ^on ^208 * echo $[7]0 $1 Class[$format(7 $2)] newtype    ==> $3-
  77.  
  78. # define RPL_TRACECLASS       209
  79. ^on ^209 * echo $[7]0 -==- $1$format(7 [$2]) Entries linked: $3
  80.  
  81. # numeric 261   A debug file type in a trace
  82. ^on ^261 * echo $[7]0 $1 Level$format(7 [$3])  $[9]xbogus ==> $2
  83.  
  84.  
  85. # Stats information
  86. # -----------------
  87.  
  88. alias statsltime {
  89.     if ([$1] != [])
  90.         {@function_return = left(19 $*)}
  91.         {@function_return = left(16 $shorttime($tdiff($0)))}
  92. }
  93.  
  94. # takes time as returned from $tdiff() e.g. 23 days 1 hour 32 minutes 10 seconds
  95. #  and puts it in the format   23d 1h 32m 10s
  96. alias shorttime {
  97.     @ function_return = [$0] ## left(1 $1) ## [ $2] ## left(1 $3) ## [ $4] ## left(1 $5) ## [ $6] ## left(1 $7)
  98. }
  99.  
  100. alias stats {
  101.     if ([$0] == [l])
  102.     {
  103.         echo $lformat(17 Server) $lformat(40 Link) $lformat(16 Connect Time)
  104.         if (vercomp($R 2.8.20) >= 0)
  105.         {
  106.             echo $lformat(10 SendQ) $lformat(10 SendM) $lformat(10 SendKBytes) $lformat(10 RcveM) $lformat(7 RcveKBytes)
  107.         }
  108.         {
  109.             echo $lformat(10 SendQ) $lformat(10 SendM) $lformat(10 SendBytes) $lformat(10 RcveM) $lformat(7 RcveBytes)
  110.         }
  111.     }
  112.     //stats $*
  113. }
  114.  
  115. # define RPL_STATSLINKINFO    211
  116. ^on ^211 * ^echo $[17]0 $[40]1 $statsltime($7-);echo $[10]2 $[10]3 $[10]4 $[10]5 $[7]6
  117. ^on ^211 "% *.*[*.*] *" ^echo $[17]0 $[40]1 $statsltime($7-);echo $[10]2 $[10]3 $[10]4 $[10]5 $[7]6
  118. ^on ^211 "% *[*" if (trace) {^echo $[17]0 $[40]1 $statsltime($7-);echo $[10]2 $[10]3 $[10]4 $[10]5 $[7]6}
  119. # ^on ^211 * ^echo $[7]0 $[20]1 $[10]3 $[10]5 $7-
  120.  
  121. # define RPL_STATSCOMMANDS    212
  122. ^on ^212 * ^echo $[7]0 $[10]1 :  $[-10]2 $[-10]3
  123.  
  124. # define RPL_STATSCLINE       213
  125. # ^on ^213 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  126.  
  127. # define RPL_STATSNLINE       214
  128. # ^on ^214 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  129.  
  130. # define RPL_STATSILINE       215
  131. ^on ^215 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  132.  
  133. # define RPL_STATSKLINE       216
  134. ^on ^216 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  135.  
  136. # define RPL_STATSQLINE      217
  137. ^on ^217 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  138.  
  139. # define RPL_STATSYLINE      218
  140. # ^on ^218 * ^echo $[7]0 $1:$[5]2:$[5]3:$[5]4:$[5]5:$6-
  141.  
  142. #
  143. # 220 is used by .troy versions to return information on
  144. # host masks being enforced locally.
  145. #
  146. ^on ^220 * ^echo $[7]0 $1: $[25]2:$3: $[25]4:$5:$6-
  147.  
  148. # User Mode (2.1.5 actually knows about this. This is for 2.1.4e)
  149. # define RPL_UMODEIS          221
  150. ^on ^221 * ^echo  $[7]0 Your user mode is $1
  151.  
  152. ^comment Service list:
  153. ^on ^231 * ^echo  $[7]0 Service $1 ($0)
  154.  
  155. ^comment Ban list:
  156. ^on ^367 * ^echo $[7]0 ban in [ $[15]1 ] for [ $[30]2- ]
  157.  
  158. ^on ^369 * if (SHOW_END_OF_MSGS==[ON])
  159.     {
  160.         if (SHOW_NUMERICS==[ON]) {echo 369 $1-} {echo *** $1-}    
  161.     }
  162.  
  163. alias vercomp {
  164.     @ vc.one = [$0]
  165.     @ vc.two = [$1]
  166.  
  167.   if (vc.one == vc.two) {
  168.     @function_return = 0
  169.   }
  170.   {
  171.     # Mika totally broke the version syntax.. annoying SOB
  172.     if (match(2.8/dog3* $vc.one)) { @ vc.one = [2.8.16.dog3] }
  173.     if (match(2.8/dog3* $vc.two)) { @ vc.two = [2.8.16.dog3] }
  174.  
  175.     while (left($index(. $vc.one) $vc.one) == left($index(. $vc.two) $vc.two))
  176.     {
  177.         @ vc.one = mid(${index(. $vc.one) +1} 30 $vc.one)
  178.         @ vc.two = mid(${index(. $vc.two) +1} 30 $vc.two)
  179.     }
  180.     if (vc.one > vc.two)
  181.         { @function_return = 1 }
  182.         { @function_return = -1 }
  183.   }
  184.   ^assign -vc.one
  185.   ^assign -vc.two
  186. }
  187.     
  188.